﻿<s:ScatterViewItem x:Class="GISforTT_API.MapLayersMangerPanel" 
                   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"                   
                   xmlns:s="http://schemas.microsoft.com/surface/2008"
                   xmlns:esri="http://schemas.esri.com/arcgis/client/2009"  
                   xmlns:src="clr-namespace:GISforTT_API"                   
                   Background="Transparent"
                   RenderTransformOrigin="0.5,0.5" ClipToBounds="True"
                   CanMove="True" CanRotate="True" CanScale="False">
    
    
    <Grid Background="White">
            <Grid.RowDefinitions>
                <RowDefinition Height="30"/>
                <RowDefinition Height="70"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="30"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="30"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="30"/>
            </Grid.ColumnDefinitions>
        
        <s:SurfaceButton Name="Close_Button" Background="White" Grid.Column="2" Padding="5" Click="Close_Button_Click"  TouchDown="Close_Button_Click">
            <Image Source="Resources\Buttons\Delete.png"/>
        </s:SurfaceButton>

        <StackPanel Orientation="Horizontal" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3">

            <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
                <TextBlock FontWeight="Bold" HorizontalAlignment="Center" Text="Please enter a Name and the URL of the ArcGIS Map Layer Server" />

                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" >
                    <TextBlock Text="Name: " Width="80" TextAlignment="Right" VerticalAlignment="Center" />
                    <TextBox x:Name="IDTextBox" Text="NewMapLayer" Width="550"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="URL: " Width="80" TextAlignment="Right" VerticalAlignment="Center" />
                    <TextBox x:Name="UrlTextBox" Text="http://services.arcgisonline.com/ArcGIS/rest/services/Reference/ESRI_Transportation_World_2D/MapServer" Width="550"/>
                </StackPanel>

            </StackPanel>
            <s:SurfaceButton x:Name="AddLayerButton" Content="Add Layer" Width="75" Height="25" Margin="10" HorizontalAlignment="Center" Click="AddLayerButton_Click" />

        </StackPanel>


        <s:SurfaceListBox Name="MapLayersListBox" Background="Beige" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="3">
            <s:SurfaceListBox.ItemTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal">
                        <s:SurfaceCheckBox Name="LayerCheckBox" Width="25" Height="25" IsChecked="{Binding Visible, Mode=TwoWay}"/>
                        
                        <s:SurfaceButton Name="DeleteLayerButton" Width="25" Height="25" Padding="5" Background="Yellow" Click="DeleteLayerButton_Click">
                            <Image Source="Resources\Buttons\Trash.png"/>
                        </s:SurfaceButton>
                        <TextBlock Text="{Binding ID}" Margin="10" />
                </StackPanel>
            </DataTemplate>
            </s:SurfaceListBox.ItemTemplate>
        </s:SurfaceListBox>

    </Grid>
</s:ScatterViewItem>
